package com.lianyou.chapter01;

/**
 * @Author: wangzhen
 * @Date: 2024-08-30 9:21
 * @Version: v1.0.0
 * @Description: TODO
 **/
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

@Data
public class Car {

    @NotNull(message = "must not be null")
    private String manufacturer;

    @NotNull
    @Size(min = 2, max = 14,message = "size must be between 2 and 14.")
    private String licensePlate;

    @Min(2)
    private int seatCount;

    public Car(String manufacturer, String licencePlate, int seatCount) {
        this.manufacturer = manufacturer;
        this.licensePlate = licencePlate;
        this.seatCount = seatCount;
    }

    //getters and setters ...
}